package org.marsson.bNav;

import javax.swing.ImageIcon;
import javax.swing.JButton;

public class ShipButton extends JButton {
	private int quantity=2;
	private String name;
	
	public ShipButton(String a ,ImageIcon b){
		super(a,b);
		this.name = a;
		this.setText(this.getText()+"("+quantity+")");
	}

	public int getQuantity() {
		return quantity;
	}

	public void decreaseQuantity() {
		this.quantity = quantity-1;
		this.setText(this.name+"("+quantity+")");
		if(quantity == 0){
			this.setEnabled(false);
		}
	}
	

}
